package com.hyz.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

/**
 * @author HGD
 * @date 2022/9/15 15:33
 */
@Configuration
public class PasswordConfig {
    /**
     * 这个配置 SpringSecurity 用来对密码加密和解密的工具类。
     *
     * @return BCryptPasswordEncoder 工具类
     */
    @Bean
    public PasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder();
    }
}
